/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2024-06-05
 * Time: 20:35
 */


class Animal{
    public String name;
    public int age;
    public String color;

    public Animal(){

    }

    public Animal(String name) {
        this.name = name;
    }

    public Animal(int age) {
        this.age = age;
    }

    public Animal(String name, String color) {
        this.name = name;
        this.color = color;
    }

    public void eat(){
        System.out.println(name + "正在吃粮 ———— Animal" );
    }
    public void swap(){
        System.out.println(name + "正在摇尾巴———— Animal");
    }
}

class Dog extends Animal{
    public Dog() {
    }
    public Dog(String name){
        super(name);
    }
    public Dog(int age){
        super(age);
    }
    public Dog(String name,String color){
        super(name,color);
    }


    public void eat(){
        System.out.println(name + "正在吃狗粮 ———— Dog");
    }

    public void swap(){
        System.out.println(name + "正在摇尾巴 ———— Dog");
    }
}
public class Test {
    public static void main(String[] args) {
        Animal animal = new Animal("初三","黄色");
        animal.eat();
        animal.swap();

        System.out.println("================");

        Animal animal1 = new Dog("初一","白色");
        animal1.eat();
        animal1.swap();
    }
}
